import exp from 'constants';
import requestTypes from '../common';

// 租户列表
const sysTenantPage = <T = any>(parameter: object = {}) => {
	return requestTypes<T>({
		url: '/sysTenant/page',
		method: 'get',
		params: parameter,
	});
}
// 新增租户
const sysTenantAdd = <T = any>(parameter: object = {}) => {
	return requestTypes<T>({
		url: '/sysTenant/add',
		method: 'post',
		data: parameter,
	});
}
// 删除租户
const sysTenantDelete = <T = any>(parameter: object = {}) => {
	return requestTypes<T>({
		url: '/sysTenant/delete',
		method: 'post',
		data: parameter,
	});
}
// 编辑租户
const sysTenantEdit = <T = any>(parameter: object = {}) => {
	return requestTypes<T>({
		url: '/sysTenant/edit',
		method: 'post',
		data: parameter,
	});
}
// 拥有菜单
const sysTenantOwnMenu = <T = any>(parameter: object = {}) => {
	return requestTypes<T>({
		url: '/sysTenant/ownMenu',
		method: 'get',
		params: parameter,
	});
}

// 重置密码
const sysTenantResetPwd = <T = any>(parameter: object = {}) => {
	return requestTypes<T>({
		url: '/sysTenant/resetPwd',
		method: 'post',
		data: parameter,
	});
}
// 获取系统菜单树，用于给角色授权时选择
const sysMenuTreeForGrant = <T = any>(parameter: object = {}) => {
	return requestTypes<T>({
		url: '/sysMenu/treeForGrant',
		method: 'get',
		params: parameter,
	});
}

// 保存选中的菜单
const saveSelectedMenu = <T = any>(parameter: object = {}) => {
	return requestTypes<T>({
		url: '/sysTenant/grantMenu',
		method: 'post',
		data: parameter,
	});
}



export default {
    sysTenantPage,
    sysTenantAdd,
    sysTenantDelete,
    sysTenantEdit,
    sysTenantOwnMenu,
    sysTenantResetPwd,
    sysMenuTreeForGrant,
	saveSelectedMenu,
}